<?php
namespace App\Console\Commands\Operation;

use Illuminate\Console\Command;
use App\Logic\Operation\CheckStarOperation as LCheckStarOperation;
class CheckStarOperation extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'check:operation-star {date=null}';

    /**
     * The console command description.
     * @var string
     */
    protected $description = 'check operation-star';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $date = $this->argument('date');
        if($date == 'null'){
            $date = date('Y-m-d',strtotime('-2 days'));
        }

        LCheckStarOperation::handle($date);
        $this->info('同步完成！');
    }
}
